package com.java2104.service;

import com.java2104.entity.Account;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class AccountService {
    private static Map<String,Account> allAccounts;
    static {
        allAccounts=new HashMap<>();
        allAccounts.put("001",new Account("001",1000));
        allAccounts.put("002",new Account("002",1000));
        allAccounts.put("003",new Account("003",1000));
        allAccounts.put("004",new Account("004",1000));

    }
    //编写一个业务方法，通过ID查询余额
    public  Account findAccById(String id ){
        return  allAccounts.get(id);
    }
}
